$( document ).on( "pageshow", "#myIntegralInfo", function( event ) {
	loadMyIntegralInfo();
	//积分总数
	//$( document ).on( "click", "#integralTotalDiv", function( event ) {
	//	goTo(rootPath+"/jsp/weixin/myIntegralDetail.jsp?access_token="+access_token+"",false);
	//});
	//今日
	$( "#todayIntegralLi" ).on( "click", function( event ) {
		goTo(rootPath+"/jsp/weixin/myIntegralDetail.jsp?access_token="+access_token+"&type=TODAY",true);
	});
	//本周
	$( "#weekIntegralLi" ).on( "click",function( event ) {
		goTo(rootPath+"/jsp/weixin/myIntegralDetail.jsp?access_token="+access_token+"&type=WEEK",true);
	});
	//本月
	$( "#monthIntegralLi" ).on( "click",function( event ) {
		goTo(rootPath+"/jsp/weixin/myIntegralDetail.jsp?access_token="+access_token+"&type=MONTH",true);
	});
	//本年
	$( "#yearIntegralLi" ).on( "click",function( event ) {
		goTo(rootPath+"/jsp/weixin/myIntegralDetail.jsp?access_token="+access_token+"&type=YEAR",true);
	});
	//幸运大转盘
	$( "#luckIntegralLi" ).on( "click",function( event ) {
		goTo(rootPath+"/jsp/weixin/myIntegralDetail.jsp?access_token="+access_token+"&type=LUCKDRAW",true);
	});
	//谁是红花王
	$( "#whoFlowerIntegralLi" ).on( "click",function( event ) {
		goTo(rootPath+"/jsp/weixin/myIntegralDetail.jsp?access_token="+access_token+"&type=FLOWERKING",true);
	});
});
//积分详情
function loadMyIntegralInfo(){
	$.ajax({
	  	url: rootPath+"/ingegral/getAddIntegralNumCount.do",
	  	type: "POST",
	  	dataType: "text",
		data: "access_token="+access_token,
	  	success: function( re ) {
	  		var data=$.parseJSON(re);
			if(data.state=="200"){
		  		var integral=data.data;
		  		$("#integralTotal").text(integral.totalNum==null? 0 :integral.totalNum);
		  		$("#todayIntegral").text(integral.todayStatNum==null? 0 :integral.todayStatNum);
		  		$("#weekIntegral").text(integral.weekStatNum==null? 0 :integral.weekStatNum);
		  		$("#monthIntegral").text(integral.monthStatNum==null? 0 :integral.monthStatNum);
		  		$("#yearIntegral").text(integral.yearStateNum==null? 0 :integral.yearStateNum);
		  		$("#luckIntegral").text(integral.luckDraw==null? 0 :integral.luckDraw);
		  		$("#whoFlowerIntegral").text(integral.flowerKing==null? 0 :integral.flowerKing);
			}else{
				alert_wx('fail',data.msg);
			}
	  	}
	});
}